import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LoginPanel extends JPanel implements ActionListener {
    private Icon bgLogin = Util.getIcon("/images/buttonLand.jpg");
    private JButton loginButton = new JButton(bgLogin);
    private ATM frame;

    public LoginPanel(ATM frame) {
        this.frame = frame;
        this.setLayout(null);
        this.setOpaque(false);
        loginButton.setBounds(300, 300, 100, 50);
        this.add(loginButton);
        loginButton.addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == loginButton) {
            frame.switchPanel("menu");
        }
    }
}
